﻿using System;
using System.Threading;
using System.Threading.Tasks;

namespace K9Nano.Admin.Weixin.OAuth
{
    public interface IWeixinAppSettingManager
    {
        ValueTask<WeixinAppSettingInfo> GetAsync(string clientId, CancellationToken cancellation);

        WeixinAppSettingInfo Get(string clientId);

        ValueTask AddOrUpdateAsync(WeixinAppSettingInfo setting, CancellationToken cancellation);

        ValueTask DeleteAsync(string clientId, string appId, CancellationToken cancellation);
    }

    [Serializable]
    public class WeixinAppSettingInfo
    {
        public string ClientId { get; set; }

        public string AppId { get; set; }

        public string AppSecret { get; set; }
    }
}